﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace CDCWnd
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            Application.Run(new frmConnection());
        }

        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            if (MessageBox.Show(null,
                "Error : " + e.Exception.Message + Environment.NewLine + e.Exception.GetType().ToString()  +"Occured" + Environment.NewLine + " Continue ?",
                "error", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.No)
            {
                System.Environment.Exit(e.Exception.GetHashCode());
            }
        }
    }
}
